#include "executionterminalengineinterface.h"
#include "EngineInterfaceImplementation/updatedenginesignalemitter.h"
#include <QtDebug>

ExecutionTerminalEngineInterface::ExecutionTerminalEngineInterface()
{
    theUpdateSignalEmmiter = new ExecTerminalImplNS::UpdatedEngineSignalEmitter;
}

ExecutionTerminalEngineInterface::~ExecutionTerminalEngineInterface()
{
    delete theUpdateSignalEmmiter;
}

void ExecutionTerminalEngineInterface::goToAddress(int pageNumber, const QString & url)
{
    qDebug() << "ETEInterface::goToAddress(int pageNumber, const QString & address)"
        << pageNumber << url;
}  
void ExecutionTerminalEngineInterface::goBack()
{
    qDebug() << "ETEInterface::goBack()";
}

void ExecutionTerminalEngineInterface::goForward()
{
    qDebug() << "ETEInterface::goForward()";

}
void ExecutionTerminalEngineInterface::refresh()
{
    qDebug() << "ETEInterface::refresh()";

}
void ExecutionTerminalEngineInterface::stop()
{
    qDebug() << "ETEInterface::stop()";

}

void ExecutionTerminalEngineInterface::getPageParams(int pageNumber, QString * address, QString * name, QIcon * icon)
{
    qDebug() << "ETEInterface::getPageParams";

}
void ExecutionTerminalEngineInterface::tilePages()
{
    qDebug() << "ETEInterface::tilePages()";

}

void ExecutionTerminalEngineInterface::createNewPage(int p)
{
    qDebug() << "ETEInterface::createNewPage(int)" << p;

}

void ExecutionTerminalEngineInterface::pageSelected(int newPage)
{
    qDebug() << "ETEInterface::pageSelected(int newPage)" << newPage;

}

void ExecutionTerminalEngineInterface::pageClosed(int p)
{
    qDebug() << "ETEInterface::pageClosed(int)" << p;

}

void ExecutionTerminalEngineInterface::connectUpdatesReceiver(QObject * receiver)
{
    Q_ASSERT(receiver != 0);
    if (receiver != 0)
    {
        QObject::connect(theUpdateSignalEmmiter, SIGNAL(engineUpdated(int, int)), receiver, SLOT(receiveEngineUpdate(int, int)));
    }
}

void ExecutionTerminalEngineInterface::updatePageInfo(int pageNumber, int changeTypeId)
{
    theUpdateSignalEmmiter->emitUpdateSignal(pageNumber, changeTypeId);
}

bool ExecutionTerminalEngineInterface::isAddressCorrect(const QString & addr)const
{ 
    return true;
}



